//调用与用户相关的接口的请求

import request from "@/utils/request"

//提供注册接口
export const registerService =(data) =>{
    //data  ---- 对象
    //接口要求的参数 x-www-form-urlencoded  ?username=xxxx&password=xxx
    //URLSearchParams
    let registerParams=new URLSearchParams(data);//将{}换为 ?username=xxxx&password=xxx
    return request.post("/user/register",registerParams)

}
export const loginService =(data) =>{
    let loginParams=new URLSearchParams(data);//将{}换为 ?username=xxxx&password=xxx
    return request.post("/user/login",loginParams)

}